package liany.xk.service;

import liany.xk.common.MD5;
import liany.xk.mapper.SysUserMapper;
import liany.xk.model.SysUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class SysUserService {
    @Autowired
    private SysUserMapper sysUserMapper;
    public boolean selectByUserName(String username, String password){
        SysUser sysUser = sysUserMapper.selectByUserName(username,password);
      if(sysUser == null){
           System.out.println("账号输入错误!");
           return false;
      }else{
         String pwd = MD5.MD5Util(password);
         if(pwd.equals(sysUser.getPassword())){
            System.out.println("登录成功");
            return true;
         }
      }
        return false;
    }
}
